import requests

# 调用huggingface在线模型，这是一个自动续写模型，多调几次可能会失败
API_URL = "https://api-inference.huggingface.co/models/uer/gpt2-chinese-cluecorpussmall"
API_TOKEN = "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"
headers = {"Authorization": f"Bearer {API_TOKEN}"}
resp = requests.post(API_URL,headers = headers, json={"inputs": "帮我介绍下李白:"})
print(resp.json())
